package com.kzx.blog.util;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
 * @author kongz
 * @version 1.0 2021/11/29 15:44
 * @description md5工具类
 */
public class MD5Utils {

    /**
     * 用户密码加密方式
     * @param account 用户账户名
     * @param password 用户密码
     * @return 加密后的字符串
     */
    public static String getMd5Password(String account, String password) {

        String str = "account:" + account + ",password:" + password;
        return DigestUtils.md5DigestAsHex(DigestUtils.md5DigestAsHex(str.getBytes(StandardCharsets.UTF_8)).getBytes(StandardCharsets.UTF_8));
    }

    public static void main(String[] args) {
        System.out.println(getMd5Password("15938870619", "kongfu"));
    }

}
